public class 抽象工厂 {
    public static void main(String[] args) {
        Factorya factorya =new AppleFactoryaImpl();
        Phonea phonea = factorya.create();
        factorya.N95Create();
        Mask mask= factorya.N95Create();
        mask.call();

    }
}
interface Factory{
    public Phonea create();
    public Mask N95Create();
}
class AppleFactoryImpl implements Factorya
{
    @Override
    public Phonea create() {
        return new Applea();
    }

    @Override
    public Mask N95Create() {
        return new n95Create();
    }

}
class HuaWeiFactoryImpl implements Factorya
{
    @Override
    public Phonea create() {
        return new HuaWeia();
    }

    @Override
    public Mask N95Create() {
        return new n95Create();
    }

}


interface Mask
{
    public void call();


}

class n95Create implements Mask {
    @Override
    public void call() {
        System.out.println("n95");
    }
}
interface Phone
{
    public void call();


}
class Apple implements Phonea
{
    @Override
    public void call() {
        System.out.println("apple");
    }

}
class HuaWei implements Phonea
{
    @Override
    public void call() {
        System.out.println("HuaWei");
    }


}
